// Copyright 2016 Rick Waldron.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-applying-the-exp-operator
description: If abs(base) < 1 and exponent is −∞, the result is +∞.
---*/


function Test() {
    var exponent = -Infinity;
    var bases = [];
    bases[0] = 0.999999999999999;
    bases[1] = 0.5;
    bases[2] = +0;
    bases[3] = -0;
    bases[4] = -0.5;
    bases[5] = -0.999999999999999;

    for (var i = 0; i < bases.length; i++) {
      if (Math.pow(bases[i], exponent) !== +Infinity) {
        throw new Test262Error("(" + bases[i] + " ** " + exponent + ") !== +Infinity");
      }
    }
}

// preheat
const NUMBER_OF_PREHEAT = 1;
for (let i = 0; i < NUMBER_OF_PREHEAT; i++) {
    Test();
}

ArkTools.jitCompileAsync(Test);
assert.sameValue(ArkTools.waitJitCompileFinish(Test), true, '[JIT] JIT disabled.');

// test
const NUMBER_OF_TEST = 1; // or 2
for (let i = 0; i < NUMBER_OF_TEST; i++) {
    Test();
}
